<?php
include_once("admin/inc.php");
include_once($INCLUDE."/main/database_access.php");
include_once($INCLUDE."/main/system_access.php");
include_once($INCLUDE."/main/ProcedureMediatorFactory.php");

$db_test = new DataBaseAccess();
$test = new SystemAccess($db_test->getConnection());
//*/
echo $test->getPath($_GET["com"], COMPONENTS)."<br/>";
echo $test->getPath($_GET["com"], MODULES)."<br/>";
echo $test->getPath($_GET["com"], TEMPLATES)."<br/>";
print_r($test->getParentArray($_GET["com"]));
echo "<br/>";
/*/

if (isset($_GET["name"])) {
	$str_name = $_GET["name"];
	$str_compName = COMPONENTS.$str_name.".php";	
	include_once($test->getPath($str_name, COMPONENTS)."/$str_compName");	
}
//*/
$a=new ProcedureMediatorFactory($LIBS."/lib_contract/");
$b=$a->getNewObject("ContractProcedureMediator");
//$c=$b->getProcedure("ACTSERVICE",6);
$c=$b->getService(6);
$contrato=$a->getNewObject("ContractTableObject");
$contrato->fecha_ini_ctrto["value"]="2007-02-18";
$contrato->fecha_fin_ctrto["value"]="2008-06-14";
$contrato->vigencia_ctrto["value"]="2009-03-02";
$contrato->alcance_ctrto["value"]="Alcance del Contrato";
$contrato->num_ctrto["value"]=45;
$contrato->cant_usuarios["value"]=15;
$contrato->valor_ctrto["value"]=450000;
$contrato->num_ctrto_ente_terr["value"]="ad45896";
$contrato->num_acto_admin["value"]="1456a3s";
$contrato->fecha_acto_admin["value"]="2007-02-20";
$contrato->fecha_legal["value"]="2007-02-22";
$contrato->estado_ctrto["value"]=1;
$contrato->upc["value"]=2;
$contrato->porcentaje_upc["value"]=0.5;
//print_r($contrato);
$org=$b->getObject("Organization",1);
$entidad=$b->getObject("ContractorEntity",1);
$programas=$b->getProgrambyService(1);
$act1=$b->getActivitybyService(1);
$act2=$b->getActivitybyProgram(1);
//print_r($act2);
/*echo "<br>";
print_r($org);
echo "<br>";
print_r($c);*/
$b->addContract($contrato,$org,$entidad,NULL,$c,$programas,$act1,$act2);


?>